package com.aaa.rent.controller.api;

import com.aaa.entity.Shop;
import com.aaa.entity.SysDictData;
import com.aaa.rent.service.ShopService;
import com.aaa.vo.MainRecordVo;
import com.aaa.vo.Result;
import com.aaa.vo.ShopVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * #Description 代理门店
 * @author 荆豪峰
 * @version 1.0
 * #Date: 2023/3/1 17:02
 */
@Api(value = "rent/shop", tags = {"#Description 代理门店 #Date: 2023/3/1 17:02"})
@RestController
@RequestMapping("rent/shop")
public class ApiShopController {
    @Autowired
    private ShopService shopService;
    /**
     * #Description 代理门店查询
     * @param currentPage
 * @param pageSize
 * @param shopVO
     * @return com.aaa.vo.Result
     * @author 荆豪峰
     * #Date 2023/3/2
     */
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "int", name = "currentPage", value = "", required = true),
            @ApiImplicitParam(paramType = "query", dataType = "int", name = "pageSize", value = "", required = true),
            @ApiImplicitParam(paramType = "body", dataType = "ShopVo", name = "shopVO", value = "", required = true)
    })
    @ApiOperation(value = "#Description 代理门店查询 #Date 2023/3/2", notes = "#Description 代理门店查询 #Date 2023/3/2", httpMethod = "POST")
    @PostMapping("list")
    public Result list(Integer currentPage, Integer pageSize, @RequestBody ShopVo shopVO){
        return shopService.list(currentPage,pageSize,shopVO);
    }
    /**
     * #Description 代理门店添加
     * @param shop
     * @return com.aaa.vo.Result
     * @author 荆豪峰
     * #Date 2023/3/2
     */
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", dataType = "Shop", name = "shop", value = "", required = true)
    })
    @ApiOperation(value = "#Description 代理门店添加 #Date 2023/3/2", notes = "#Description 代理门店添加 #Date 2023/3/2", httpMethod = "POST")
    @PostMapping("insert")
    public Result insert(@RequestBody Shop shop){
        return shopService.insert(shop);
    }
    /**
     * #Description 代理门店删除
     * @param id
     * @return com.aaa.vo.Result
     * @author 荆豪峰
     * #Date 2023/3/2
     */
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "int", name = "id", value = "", required = true)
    })
    @ApiOperation(value = "#Description 代理门店删除 #Date 2023/3/2", notes = "#Description 代理门店删除 #Date 2023/3/2", httpMethod = "DELETE")
    @DeleteMapping("delete")
    public Result delete(Integer id){
        return shopService.delete(id);
    }
    /**
     * #Description 代理门店修改
     * @param shop
     * @return com.aaa.vo.Result
     * @author 荆豪峰
     * #Date 2023/3/2
     */
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", dataType = "Shop", name = "shop", value = "", required = true)
    })
    @ApiOperation(value = "#Description 代理门店修改 #Date 2023/3/2", notes = "#Description 代理门店修改 #Date 2023/3/2", httpMethod = "POST")
    @PostMapping("update")
    public Result update(@RequestBody Shop shop) {
        return shopService.update(shop);
    }

    @ApiOperation(value = "", notes = "")
    @RequestMapping("selectShop")
    public Result selectShop(){
        return shopService.selectShop();
    }
}
